import { createApp } from "vue";
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from "./App.vue";
import "./index.css";
import axios from "axios";

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// const app = createApp(App)


// !挂载全局变量到vue原型的方法
// createApp(App).config.globalProperties.$Test = test;
// !使用全局变量
// import { getCurrentInstance } from 'vue';
// const { proxy } = getCurrentInstance();
// proxy.$Test(); 就可以调用这个方法；

axios.get("./static/config.json").then(({ data }) => {
  const app = createApp(App);

  // 注册图标
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }

  app.config.globalProperties.BASE_URL = data.BASE_URL;
  app.use(ElementPlus)
  app.mount("#app");
});
